package com.sjd.quartz.task;

import com.sjd.farm.service.ISjdFarmLandClaimOrderService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 * 农场土地相关定时任务
 *
 * @author maple
 */
@Component("farmLandTask")
@Slf4j
@AllArgsConstructor
public class FarmLandTask {
    private final ISjdFarmLandClaimOrderService orderService;

    /**
     * 校验用户名下土地是否过期
     */
    public String checkFarmLandIsOverDue() {
        LocalDateTime now = LocalDateTime.now();
        log.info("{}-校验用户名下土地是否过期定时任务执行", now);
        String result = orderService.checkFarmLandIsOverDue(now);
        log.info("{}-校验用户名下土地是否过期定时任务结束,执行结果：{}", now, result);
        return result;
    }

}
